SecureLLM is a prototype security in LLM chatbot designed to answer vulnerability related questions using a retrieval augmented architecture.
The system retrieves CVE vulnerability records from a FAISS vector index built from NVD data and uses a language model to generate structured responses.
This repository contains the V1 baseline implementation.
SecureLLM uses a two stage pipeline.
A FAISS vector index stores vulnerability descriptions extracted from CVE records. Queries are embedded using SentenceTransformers and matched against the index to retrieve the most relevant vulnerability records.
Retrieved vulnerability records are filtered and formatted using rule based logic. A language model then generates a readable explanation using the retrieved security context.
SecureLLM
│
├── V1_Scripts
│ ├── __init__.py
│ ├── retrieval_utils.py
│ └── response_utils.py
│
├── initial
│ ├── securellm_chunks.pkl
│ └── securellm_faiss.index
│
├── inference_SecureLLM_CPU_V1.py
├── initial_testing_retrieval.py
├── environment.yml
├── README.md
└── .gitignore
This project was developed using:
- macOS
- Python 3.10
- Conda environment manager
Main libraries used:
transformerssentence-transformersfaisspytorchnumpy
The environment can be recreated using the included environment.yml.
Clone the repository
git clone https://github.com/YOUR_USERNAME/SecureLLM.git
cd SecureLLMCreate the conda environment
conda env create -f environment.ymlActivate the environment
conda activate SecureLLM_appRun the chatbot
python inference_SecureLLM_CPU_V1.pyCurrent Questions for V1:
- What is CVE-2024-0999?
- Explain CVE-2024-1002?
- List 2 vulnerabilities.
- Show me 2 recent critical vulnerabilities.
- Tell me about a Totolink vulnerability.
- Show a buffer overflow vulnerability.